<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"
%><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"
%><%@ taglib prefix="security" uri="http://www.springframework.org/security/tags"
%><%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"
%><%@ taglib prefix="tags" tagdir="/WEB-INF/tags"
%><%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"
%>
<head>
    <title><fmt:message key="folder" /></title>
</head>
<body>
    <div id="folderSearchResultFragment">
        <h1><fmt:message key="folder" /></h1>
        <script type="text/javascript">
            dojo.addOnLoad(function() {
                dojo.query(".folderAjaxSearch").forEach(function(element) {
                    Spring.addDecoration(new Spring.AjaxEventDecoration({
                        elementId: element.id,
                        event: "onclick",
                        params: { decorator: "none" }
                    }));
                })

                dojo.query(".folderAjaxDelete").forEach(function(element) {
                    Spring.addDecoration(new Spring.AjaxEventDecoration({
                        elementId: element.id,
                        event: "onclick",
                        popup: "true",
                        params: { decorator: "none" }
                    }));
                })
            });
        </script>
        <c:url var="searchUrl" value="/domain/folder/search.action"/>
        <table class="listEntities">
            <thead>
                <tr>
                    <th scope="col">
                        <a id="sortLinkpath" class="folderAjaxSearch" href="${searchUrl}?${folderSearchForm.pathQueryStringForSortableHeader}">
                            <fmt:message key="folder_path"/>&nbsp;${folderSearchForm.pathSortStatusEntity}
                        </a>
                    </th>
                    <th scope="col">
                        <a id="sortLinktitle" class="folderAjaxSearch" href="${searchUrl}?${folderSearchForm.titleQueryStringForSortableHeader}">
                            <fmt:message key="folder_title"/>&nbsp;${folderSearchForm.titleSortStatusEntity}
                        </a>
                    </th>
                    <th scope="col">
                        <a id="sortLinkshowOnMenu" class="folderAjaxSearch" href="${searchUrl}?${folderSearchForm.showOnMenuQueryStringForSortableHeader}">
                            <fmt:message key="folder_showOnMenu"/>&nbsp;${folderSearchForm.showOnMenuSortStatusEntity}
                        </a>
                    </th>
                    <th scope="col">
                        <a id="sortLinksortOrder" class="folderAjaxSearch" href="${searchUrl}?${folderSearchForm.sortOrderQueryStringForSortableHeader}">
                            <fmt:message key="folder_sortOrder"/>&nbsp;${folderSearchForm.sortOrderSortStatusEntity}
                        </a>
                    </th>
                    <th scope="col">
                        <a id="sortLinksiteInode" class="folderAjaxSearch" href="${searchUrl}?${folderSearchForm.siteInodeQueryStringForSortableHeader}">
                            <fmt:message key="folder_siteInode"/>&nbsp;${folderSearchForm.siteInodeSortStatusEntity}
                        </a>
                    </th>
                    <th scope="col">
                        <a id="sortLinkfilesMasks" class="folderAjaxSearch" href="${searchUrl}?${folderSearchForm.filesMasksQueryStringForSortableHeader}">
                            <fmt:message key="folder_filesMasks"/>&nbsp;${folderSearchForm.filesMasksSortStatusEntity}
                        </a>
                    </th>
                    <th scope="col">类型</th>
                    <th scope="col">&nbsp;</th>
                </tr>
            </thead>
            <tbody>
            <c:forEach items="${folders}" var="folder" varStatus="status">
                <tr>
                    <td>
                        <c:out value="${folder.path}"/>
                    </td>
                    <td>
                        <c:out value="${folder.title}"/>
                    </td>
                    <td>
                        <c:out value="${folder.showOnMenu}"/>
                    </td>
                    <td>
                        <c:out value="${folder.sortOrder}"/>
                    </td>
                    <td>
                        <c:out value="${folder.site.name}"/>
                    </td>
                    <td>
                        <c:out value="${folder.filesMasks}"/>
                    </td>
                    <td>
                        <fmt:message key="folder"/>
                    </td>
                    <td>
                        <c:url var="showUrl" value="/domain/folder/show.action">
                            <c:param name="folder.inode" value="${folder.inode}"/>
                        </c:url>
                        <c:url var="updateUrl" value="/domain/folder/updateForm.action">
                            <c:param name="folder.inode" value="${folder.inode}"/>
                        </c:url>
                        <c:url var="confirmDeleteUrl" value="/domain/folder/confirmDelete.action">
                            <c:param name="folder.inode" value="${folder.inode}"/>
                        </c:url>
                        <a class="actionShow" href="${showUrl}"><fmt:message key="label.link.show"/></a>
                        <a class="actionUpdate" href="${updateUrl}"><fmt:message key="label.link.update"/></a>
                        <a class="actionDelete folderAjaxDelete" id="confirmDeleteUrl${status.index}" href="${confirmDeleteUrl}"><fmt:message key="label.link.delete"/></a>
                    </td>
                </tr>
            </c:forEach>
            <c:forEach items="${pages}" var="htmlPage" varStatus="status">
				<tr>
                    <td>
                        <c:out value="${htmlPage.path}"/>
                    </td>
                    <td>
                        <c:out value="${htmlPage.title}"/>
                    </td>
                    <td>
                        <c:out value="${htmlPage.showOnMenu}"/>
                    </td>
                    <td>
                        <c:out value="${htmlPage.sortOrder}"/>
                    </td>
                    <td>
                        <c:out value="${htmlPage.site.name}"/>
                    </td>
                    <td>&nbsp;</td>
                    <td><fmt:message key="htmlPage"/></td>
                    <td>
                        <c:url var="showUrl" value="/domain/htmlPage/show.action">
                            <c:param name="htmlPage.inode" value="${htmlPage.inode}"/>
                        </c:url>
                        <c:url var="updateUrl" value="/domain/htmlPage/updateForm.action">
                            <c:param name="htmlPage.inode" value="${htmlPage.inode}"/>
                        </c:url>
                        <c:url var="confirmDeleteUrl" value="/domain/htmlPage/confirmDelete.action">
                            <c:param name="htmlPage.inode" value="${htmlPage.inode}"/>
                        </c:url>
                        <a class="actionShow" href="${showUrl}"><fmt:message key="label.link.show"/></a>
                        <a class="actionUpdate" href="${updateUrl}"><fmt:message key="label.link.update"/></a>
                        <a class="actionDelete htmlPageAjaxDelete" id="confirmDeleteUrl${status.index}" href="${confirmDeleteUrl}"><fmt:message key="label.link.delete"/></a>
                    </td>
                </tr>
            </c:forEach>

            </tbody>
            <tfoot>
                <tr>
                    <td colspan="11">
                        <p>
                            <tags:navigation pager="${pagerDisplay}" url="${searchUrl}" form="${folderSearchForm}"/>
                        </p>
                    </td>
                </tr>
            </tfoot>
        </table>
    </div>
</body>